use criterion::{criterion_group, criterion_main, Criterion};
use utf8_decoder::{decode_utf8, UTF8_ACCEPT, UTF8_REJECT};

fn benchmark_decode_utf8(c: &mut Criterion) {
    c.bench_function("utf8_decoder_decode_utf8", |b| {
        b.iter(|| {
            let mut state = UTF8_ACCEPT as u32;
            let mut codepoint = 0u32;
            let byte = 0xE2; // 示例字节，表示UTF-8字符的一部分
            decode_utf8(&mut state, &mut codepoint, byte);
        });
    });
}

criterion_group!(benches, benchmark_decode_utf8);
criterion_main!(benches);